package info.ask4research.service.impl;

import java.util.List;

import info.ask4research.dao.IRoleDAO;
import info.ask4research.dao.IToolAndMaterialDAO;
import info.ask4research.dao.core.AbstractDao;
import info.ask4research.model.addons.Addon;
import info.ask4research.model.roles.Role;
import info.ask4research.model.toolsAndMaterials.AnnouncementService;
import info.ask4research.model.toolsAndMaterials.ChatService;
import info.ask4research.model.toolsAndMaterials.ForumService;
import info.ask4research.model.toolsAndMaterials.LearningObject;
import info.ask4research.model.toolsAndMaterials.SentMailService;
import info.ask4research.model.toolsAndMaterials.ToolAndMaterial;
import info.ask4research.service.IRoleService;
import info.ask4research.service.IToolAndMaterialService;
import info.ask4research.service.core.impl.AbstractServiceImpl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service(value="toolAndMaterialService")
@Transactional
public class ToolAndMaterialService extends AbstractServiceImpl<ToolAndMaterial> implements IToolAndMaterialService{

	@Resource(name = "toolAndMaterialDAO")
	private IToolAndMaterialDAO dao;

	@Override
	public AbstractDao<ToolAndMaterial> getDao() {
		return dao;
	}
	@Override
	public void setDao(AbstractDao<ToolAndMaterial> dao) {
		this.dao = (IToolAndMaterialDAO) dao;
	}
	@Override
	public ToolAndMaterial save(ToolAndMaterial toolAndMaterial){
		return dao.save(toolAndMaterial);
	}
	@Override
	public List<LearningObject> getLearningObjectByUoL(int idUoL) {
		return dao.getLearningObjectByUoL(idUoL);
	}
	@Override
	public List<ForumService> getForumServicesByUoL(int idUoL) {
		return dao.getForumServicesByUoL(idUoL);
	}
	@Override
	public List<AnnouncementService> getAnnouncementServiceByUoL(int idUoL) {
		return dao.getAnnouncementServiceByUoL(idUoL);
	}
	@Override
	public List<ChatService> getChatServiceByUoL(int idUoL) {
		return dao.getChatServiceByUoL(idUoL);
	}
	@Override
	public List<SentMailService> getSentMailServiceByUoL(int idUoL) {
		return dao.getSentMailServiceByUoL(idUoL);
	}
	@Override
	public boolean tamNameExists(String stringTam, int idUoL) {
		return dao.tamNameExists(stringTam, idUoL);
	}
	@Override
	public ToolAndMaterial getTaMByUoFandTamName(String stringTam, int idUoL) {
		return dao.getTaMByUoFandTamName( stringTam, idUoL);
	}
	@Override
	public List<ToolAndMaterial> getTamByUoL(int id) {
		return dao.getTamByUoL(id);
	}
}
